<!DOCTYPE html>
<html lang="en" 
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      >
    <f:view>
        <h:head>
            <title>JSF 2.3: Converter Injection Sample</title>
        </h:head>
        <h:body>
            <h1>JSF 2.3: Converter Injection Example </h1>

            <h:panelGroup id="messagePanel">
                Tags: #{backingBean.tags}
                My Tags: #{backingBean.mytags}
            </h:panelGroup>

            <h:form id="form">

                <div>
                    <h:outputLabel for="tags" value="Tags" />
                    <h:inputText 
                        id="tags" 
                        value="#{backingBean.tags}">
                        <f:converter converterId="tagsConverter" />
                    </h:inputText>    
                </div>

                <div>
                    <h:outputLabel for="mytags" value="My Tags" />
                    <h:inputText 
                        id="mytags" 
                        value="#{backingBean.mytags}">
                        <f:converter binding="#{backingBean.mytagsConverter}"/>
                    </h:inputText>     
                </div>

                <div>
                    <h:commandButton 
                        id="save" 
                        value="Save">
                        <f:ajax execute="@form" render=":messagePanel" />
                    </h:commandButton>
                </div>
            </h:form>

        </h:body> 
    </f:view>
</html>